package com.bocomm.tracevisualization.controller;


import com.bocomm.tracevisualization.api.result.Result;
import com.bocomm.tracevisualization.api.service.ITraceTargetDataService;
import com.bocomm.tracevisualization.api.vo.req.BrokenLineReq;
import com.bocomm.tracevisualization.api.vo.resp.BrokenLineGraph;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 每次traceroute请求的结果数据 前端控制器
 * </p>
 *
 * @author cxp
 * @since 2024-03-20
 */
@RestController
@RequestMapping("/api/traceTargetData")
public class TraceTargetDataController {

    @Autowired
    ITraceTargetDataService traceTargetDataService;

    @PostMapping("/brokenLine")
    public Result<BrokenLineGraph> brokenLine(@RequestBody BrokenLineReq req){
        BrokenLineGraph brokenLineGraph = traceTargetDataService.brokenLine(req);
        return Result.success(brokenLineGraph);
    }
}
